// pages/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    userInfo:{},
    logged:false,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getUserInfo()
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  },

  getUserInfo: function (cb) {
    var that = this
    wx.login({
      success: function () {
        wx.getUserInfo({
          success: function (res) {
            that.setData({
              userInfo: res.userInfo,
              logged:true,
            });
          }
        })
      }
    })
  },

  goToPoetry:function(e){
    wx.navigateTo({
      url: "/pages/poetries/poetries"
    })
  },

  goToPoems: function (e) {
    wx.navigateTo({
      url: "/pages/poems/poems"
    })
  },
})